package cn.xiuxius.askbox.pojo.dto.common;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RegisterDTO {
    private String uuid;
    @Pattern(regexp = "^[A-Za-z0-9]{6,16}$", message = "用户名不符合规范")
    @NotBlank(message = "用户名不能为空")
    private String username;

    @Pattern(regexp = "^[A-Za-z0-9]{6,32}$", message = "密码不符合规范")
    @NotBlank(message = "密码不能为空")
    private String password;

    private String displayName;

    private String avatar;

    private String phone;

    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式错误")
    private String email;

    @NotBlank(message = "验证码Key不能为空")
    private String captchaKey;

    @NotBlank(message = "验证码不能为空")
    private String captcha;


}
